import {ActionName} from "@/components/type";
import Action from "@/modal/Action";

export default class Pop {
  private show_: boolean = false;
  private actionsConfig_: ActionName[] = [];

  get actionsConfig() {return this.actionsConfig_;}

  toggle() {
    this.show_ = !this.show_;
    return this;
  }

  showType(type: ActionName) {
    if (type === ActionName.BONUS) this.actionsConfig_ = Action.bonusAction;
    else this.actionsConfig_ = Action.farmAction;
  }

  get show() {return this.show_}

  // 单例模式
  private static instance: Pop | null = null;

  public static getInstance(): Pop {
    if (this.instance === null) {
      this.instance = new Pop();
    }
    return this.instance
  }
}